import { ToastAndroid } from 'react-native';
import ImagePicker from 'react-native-image-picker';


import CommonUtils from './common';
import GlobalConfig from './Global';

var options = {
    title: '选择房型图',
    customButtons: [
    {name: 'fb', title: 'Choose Photo from Facebook'},
    ],
    storageOptions: {
    skipBackup: true,
    path: 'images'
    }
};

/**
 * 导入房型图
 */
exports.importImage = (navigate, roomType) => {
    ImagePicker.launchImageLibrary(options, (response) => {
        console.log(response);
        if (response && response.uri) {
            navigate(GlobalConfig.COVERED_TEST_VIEW, {imageUri: response.uri, roomType: roomType});
        }
    });
}
